<template>
  <div>
    <h2>GridTable</h2>
    {{ props }}
    <input v-model="f_title" />
    <ul>
      <li v-for="(u, index) in props.users" :key="'user' + index">
        {{ u.name }}
      </li>
    </ul>
  </div>
</template>

<script setup>
// 对外曝露属性接口
// 1、导入 defineProps
import { defineProps, ref } from 'vue'

const f_title = ref('')

// 属性是只读的
const props = defineProps({
  users: {
    type: Array,
    required: true
  },

  // 可以设置传来值的类型和默认值
  title: {
    type: String,
    default: '',
    required: true
  },
  src: {
    type: String,
    default: '',
    required: true
  },
  times: {
    type: Number,
    required: true
  }
})
</script>

<style lang="scss" scoped></style>
